#include "Link_list.h"

Element_data data[50]=
{
    {.name = "刘备",.sex="男",.sco=60,.age=18,.id=1},
    {.name = "关羽",.sex="男",.sco=60,.age=18,.id=2},
    {.name = "张飞",.sex="男",.sco=60,.age=18,.id=3},
    {.name = "赵云",.sex="男",.sco=60,.age=18,.id=4},
    {.name = "马超",.sex="男",.sco=60,.age=18,.id=5}

};

void test(void)
{
    //创建表
    Link_list *L =init_link_list();

    
    //头插
    insert_node(L,data[0],1);
    
    //任意插入
    insert_node(L,data[1],2);
    insert_node(L,data[2],3);
    insert_node(L,data[3],4);
    insert_node(L,data[4],5);

    printf("=================头插===================\n");
    
    //遍历打印
    printf_link_list(L);

    printf("=================删除===================\n");
    
    //删除
    delete_node(L,1);
    delete_node(L,2);

    //遍历打印
    printf_link_list(L);

    printf("===============位置查找=================\n");
    
    //位置查找
    find_node_id(L,2);
    //if( 0 == (=find_node_id(L,2)))

    printf("===============名字查找=================\n");
    
    //名字查找
    find_node_name(L,"赵云");

    printf("=================合并===================\n");
    
    //合并
    

    //遍历打印
    //printf_link_list(L);

    //销毁
    free_Link_list(&L);
}
int main()
{
    test();
    return 0;
}